import request from "@/utils/request";

const path = '/staff'

// 新增医护
export const addStaff = (data) => {
    return request({
        url: path,
        method: 'post',
        data
    })
}

// 分页查询医护
export const queryStaffPage = (params) => {
    return request({
        url: path,
        params
    })
}

// 根据id查询医护信息
export const queryStaffById = (id) => {
    return request({
        url: path + `/${id}`,
    })
}

// 修改医护信息
export const updateStaff = (data) => {
    return request({
        url: path,
        method: 'put',
        data
    })
}

// 修改医护状态 
export const updateStaffStatus = (data) =>
    request({
        'url': path + `/status/${data.status}`,
        'method': 'put',
        params: { id: data.id }
    })

// 医护批量删除
export const deleteStaffList = (data) =>
    request({
        'url': path,
        'method': 'delete',
        params: {ids: data.join(',')}
    })
